﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using ChatForum.Domain;
using System.ServiceModel.Web;

namespace ChatForum.DataContract
{
    [DataContract(Name = "Thread")]
    public class ThreadDTO : PostDTO
    {
        public ThreadDTO(Post post)
            : base(post)
        {
            UriBuilder ub = new UriBuilder(WebOperationContext.Current.IncomingRequest.UriTemplateMatch.RequestUri);
            ub.Query = "postId=" + ID;
            Link = ub.Uri;
        }
        [DataMember]
        public Uri Link { get; set; }
    }
}
